import React from 'react';
import {HashRouter as Router,Route,Switch} from 'react-router-dom';
import App from './App';
// import Login from './pages/login';
import Admin from './admin';
import Home from './pages/home';
// ui
import Buttons from './pages/ui/buttons';
import Modals from './pages/ui/modals';
import Loadings from './pages/ui/loadings';
import Notice from './pages/ui/notice';
import Messages from './pages/ui/messages';
import Tabs from './pages/ui/tabs';
import Login from './pages/form/login';
import Register from './pages/form/register';
import TableBasic from './pages/table/basic';
import TableHigh from './pages/table/high';

// *******************
import NoMatch from './pages/nomatch';//404页面

export default class IRouter extends React.Component{
  render(){
    return (
      <Router>
        <App>
          {/* <Route path="/login" component={Login}></Route> */}
          <Route path="/admin" render={()=>
            <Admin>
              <Switch>
                <Route path="/admin/home" component={Home}></Route>
                <Route path="/admin/ui/buttons" component={Buttons}></Route>
                <Route path="/admin/ui/modals" component={Modals}></Route>
                <Route path="/admin/ui/loadings" component={Loadings}></Route>
                <Route path="/admin/ui/notification" component={Notice}></Route>
                <Route path="/admin/ui/messages" component={Messages}></Route>
                <Route path="/admin/ui/tabs" component={Tabs}></Route>
                <Route path="/admin/form/login" component={Login}></Route>
                <Route path="/admin/form/reg" component={Register}></Route>
                <Route path="/admin/table/basic" component={TableBasic}></Route>
                <Route path="/admin/table/high" component={TableHigh}></Route>
                <Route component={NoMatch}></Route>
              </Switch>
            </Admin>
          }></Route>
        </App>
      </Router>
    )
  }
}